<#include "/public/macro.html">
<div class="uk-layui-form">
	<form class="layui-form" action="/agent/summary/add/save.html" data-toggle="ajax-form" method="post" data-inner="#summarys" style="padding-top: 25px;">
		<input type="hidden" name="userid" value="${userid!''}">
		<input type="hidden" name="contactsid" value="${contactsid!''}">
		<input type="hidden" name="agentserviceid" value="${agentserviceid!''}">
		<input type="hidden" name="agentuserid" value="${agentuserid!''}">
		<input type="hidden" name="sort" value="${sort!''}">
		
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label" id="cusname">服务类型：</label>
				<#if tagsSummary?? && tagsSummary?size gt 0>
					<div class="layui-input-inline" style="width: 765px;">
						<select name = "servicetype"id="servicetype" multiple="multiple" required  lay-verify="required"  style="width:100%;" lay-filter="servicetype">
							<#list tagsSummary as tag>
							<option value="${tag.id!''}" >${tag.tag!''}</option>
							</#list>
						</select>
								
					</div>
					<#else>
					<div class="layui-input-inline" style="width: 260px;top: 6px;">
						<span>请前往《客服设置》->《服务类型》配置</span>
					</div>
				</#if>
			</div>
			<div class="layui-inline">
				<font color="red">*</font>
			</div>
		</div>
		<div class="layui-form-item" style="height:53px;">
			<div class="layui-inline">
				<label class="layui-form-label">是否预约：</label>
				<div class="layui-input-inline" style="width:150px;">
					<input type="radio" name="reservation" lay-filter="reservation" value="1" title="是" checked="">
						<input type="radio" name="reservation" lay-filter="reservation" value="0" title="否">
				</div>
			</div>
			<div class="layui-inline ukefu_reservation">
				<label class="layui-form-label" style="width: 80px;">预约方式：</label>
				<div class="layui-input-inline" style="width: 120px;margin-top:0px;">
					<@select "com.dic.summary.reservtype" "reservtype" '' "lay-ignore" "width:120px;"/>
				</div>
			</div>
			<div class="layui-inline ukefu_reservation">
				<label class="layui-form-label" style="width: 80px;">预约时间：</label>
				<div class="layui-input-inline" style="width: 245px;margin-top:0px;">
					<input type="text" id="reservtime" name="reservtime" autocomplete="off" value=""
						class="layui-input">
					<i class="layui-icon" style="position: absolute;right: 3px;top: 6px;font-size: 25px;">&#xe637;</i>
				</div>
			</div>
		</div>
		
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">服务小结：</label>
				<div class="layui-input-inline" style="width: 765px;">
					<textarea name="summary" placeholder="服务小结" class="layui-textarea" style="resize:none;height:180px"></textarea>
				</div>
			</div>
		</div>
		
		<div class="layui-form-button">
			<div class="layui-button-block">
				<#if tagsSummary?? && tagsSummary?size gt 0>
					<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
				</#if>
				<button type="reset" class="layui-btn layui-btn-primary" onclick="layer.close(layer.index);">关闭</button>
			</div>
		</div>
	</form>
</div>
<script type="text/javascript" src="multiSelect.js"></script>
<script>
	layui.use('form', function() {
		var form = layui.form;
		form.render(); //更新全部
		form.on("radio(reservation)" , function(data){
			if(data.value == '1'){
				$('.ukefu_reservation').show();
			}else{
				$('.ukefu_reservation').hide();
			}	
		});
	});
	layui.use('element', function(){
		var element = layui.element;
	});
	layui.use('laydate', function() {
		var laydate = layui.laydate;
		laydate.render({ 
		  elem: '#reservtime' ,
		  type:'datetime'
		});
	});
	//$(".tags").select2();
	var multiSelect;
    layui.use(['multiSelect'], function() {
        multiSelect = layui.multiSelect;
     // 如果异步操作了数据，比如在下拉项追加了一项，使用multiSelect.render(type, filter);type, filter参数跟layui官方的form.render(type, filter)一毛一样，可前往查看
        multiSelect.render('select', 'servicetype');
    });
</script>